// component/collection/collection.js
Component({
  
  data: {
    flag:true,
    message:'',
    key:1,
    repertory:'',
    t:0,
  },
  /**
   * 组件的方法列表
   */
  methods: {
    showCollection(arr){
      console.log("Collection组件方法加载成功！")
      var flag=this.data.flag;
      console.log("-----------------------")
      console.log(arr)
      var message;
      if(arr == 1){
        message="收藏成功"
      }else{
        message="取消收藏成功"
      }
      this.setData({
        message:message,
      })
      var that = this;
     setTimeout(function() {
      that.setData({
        flag:!that.data.flag,
     })
   }, 500);  
   setTimeout(function() {
    that.setData({
      flag:!that.data.flag,
   })
 }, 1500); 
    
    }

}
})
